<%@ page import="java.sql.*" %>
<%@include file="../connection.jsp" %>

<%
	try{
		HttpSession ses = request.getSession(true);
		String ses_username = ses.getValue("ses_uname").toString();
	
	if (ses_username.equals("admin"))
	{
	
%>
<link href="../css/style.css" rel="stylesheet" />

<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><h1><br>Manajemen Artikel<br><br></h1></td>
  </tr>
  <tr>
    <td><table width="100%"  border="1" align="center" cellpadding="2" cellspacing="0">
      <tr><div align="center">
        <td width="5%" align="center">ID</td>
        <td width="10%" align="center">Judul</td>
        <td width="8%">&nbsp;</td></div>
      </tr>
	<%
		String sql = "SELECT * FROM t_artikel";
		rs = stmt.executeQuery(sql);
		
		while (rs.next())
		{   
			String id=rs.getString(1);
			String judul=rs.getString(2);
	%>	  
      <tr>
        <td><% out.print(id); %></td>
        <td><% out.print(judul); %></td>
		<td><div align="center"><a href="editinfo.jsp?id=<% out.print(id); %>">Edit</a></div></td>
      </tr>
	<%
		}
		}
		}
		
	catch(Exception e)
	{
		out.println("login Admin error");
	}
	%>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
</table>